package com.alibaba.cirtus.ots.application.adapter.ability.model.enums;

import java.util.Arrays;

/**
 * @description: 员工状态
 * @author: wangyundan
 */
public enum EmployeeStatusEnum {
    AVAIL("A", 1,"有效"),
    INVALID("I", 2,"无效");

    private final String value;
    private final Integer status;
    private final String desc;

    EmployeeStatusEnum(String value, Integer status, String desc) {
        this.value = value;
        this.status = status;
        this.desc = desc;
    }

    public Integer getStatus() {
        return status;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static EmployeeStatusEnum getByValue(String value){
        if (value == null){
            return null;
        }
        return Arrays.stream(values()).filter(statusEnum -> statusEnum.getValue().equals(value)).findAny().orElse(null);
    }
}
